#pragma once

#include "QRWCreateCurveWidget.h"
#include "ui_CreateEllipseWidget.h"

QT_BEGIN_NAMESPACE
namespace Ui { class CreateEllipseWidgetClass; };
QT_END_NAMESPACE

class MainWindow;
class ShapeOperation;

class CreateEllipseWidget : public QRWCreateCurveWidget
{
	Q_OBJECT

public:
	CreateEllipseWidget(MainWindow* inMainWindow, ShapeOperation* inOperation = nullptr, QWidget* parent = nullptr);
	~CreateEllipseWidget();
protected:

	void onPosChanged();

	virtual void OnPickPosition(const gp_Pnt& inPosition) override;
	virtual class ShapeOperation* GetOperation() override;
	virtual void GenerateFeatureShapeForCacheActor() override;
	virtual bool eventFilter(QObject* obj, QEvent* event) override;
	void OnPickDirection(const gp_Vec& inDirection) override;
	virtual void Reset() override;

	void UpdateInner();
private:
	std::pair<bool, gp_Ax2> GetCurrentAxis();
private:
	Ui::CreateEllipseWidgetClass *ui;

	int focusIndex = 0;

	// 批量修改 减少修改次数
	bool bBatchChange = false;

	RWTripleFloatInput* m_centerPnt;
	RWTripleFloatInput* m_majorVec;
	RWTripleFloatInput* m_minorVec;
};
